﻿@model IEnumerable<TCM.Expense>

@{
    ViewBag.Title = "Index";
}

<h2>Expenses</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="grdTable" style="width: 100%;" cellspacing="0">
    <thead>
<tr class="GridHeader">
    <tr>
        
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        
        <th>
            @Html.DisplayNameFor(model => model.ExpenseDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Amount)
        </th>
       
        <th>
            @Html.DisplayNameFor(model => model.ResponsibleEmployee)
        </th>
       
        <th></th>
    </tr>
        </thead>
    <tbody>

@foreach (var item in Model) {
    <tr>
      
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
      
        <td>
            @Html.DisplayFor(modelItem => item.ExpenseDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Amount)
        </td>
     
        <td>
            @Html.DisplayFor(modelItem => item.Employee.Name)
        </td>
        
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ExpenseID }) |
            @Html.ActionLink("Details", "Details", new {  id=item.ExpenseID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ExpenseID })
        </td>
       
    </tr>
}
</tbody>
</table>
